<template>
	
	<div id="brandEdit" class="container-fluid">
						
		<el-form ref="form" model="form" label-width="80px">
			  <el-form-item label="品牌名称">
			    <el-input v-model="form.brandName"></el-input>
			  </el-form-item>

			  <el-form-item label="英文名称">
			    <el-input v-model="form.brandNameEn"></el-input>
			  </el-form-item>
		     <el-form-item label="是否有效">
		          <el-radio-group v-model="form.status">
		            <el-radio :label="0" >有效</el-radio>
		            <el-radio :label="1" >无效</el-radio>
		          </el-radio-group>
	         </el-form-item>

			  <el-form-item>
			    <el-button type="primary" @click="onSubmit">保存</el-button>
			  </el-form-item>
			</el-form>		

	</div>

</template>

<script>
import axios from 'axios'

export default  {
	data(){
		return {
			form:{
				id:''	
			}
		}
	},
	mounted(){
		this.searchById();
	},
	methods: {
		searchById(){
			let param={};
			param.id=this.$route.params.id
			axios.post("/api/brand/getBrandById",param).then((res)=>{
				this.form=res.data.data;
			},(res)=>{

			});
		},
		onSubmit(){
			axios.post("/api/brand/updateBrandById",this.form).then((res)=>{
				if(res.data.code==9999){
					this.$message({
			          message: '修改成功',
			          type: 'success'
			        });
				}
			},(res)=>{

			});
		}

	}
}

</script>

<style type="text/css" >
	
</style>